package com.infocollect.project.api.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.infocollect.project.api.entity.TappActinsCommunicateEntity;
import com.infocollect.project.api.mapper.TappActinsCommunicateMapper;
import com.infocollect.project.api.service.ITappActinsCommunicateService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * (TappActinscommunicate)表服务实现类
 *
 * @author makejava
 * @since 2019-12-25 10:32:28
 */
@Service
public class TappActinsCommunicateServiceImpl extends ServiceImpl<TappActinsCommunicateMapper, TappActinsCommunicateEntity> implements ITappActinsCommunicateService {

    /**
     * 通过ID查询单条数据
     *
     * @param fid 主键
     * @return 实例对象
     */
    @Override
    public TappActinsCommunicateEntity queryById(Long fid) {
        return this.baseMapper.selectById(fid);
    }



    /**
     * 新增数据
     *
     * @param tappActinscommunicate 实例对象
     * @return 实例对象
     */
    @Override
    public TappActinsCommunicateEntity insert(TappActinsCommunicateEntity tappActinscommunicate) {
        this.baseMapper.insert(tappActinscommunicate);
        return tappActinscommunicate;
    }

    /**
     * 修改数据
     *
     * @param tappActinscommunicate 实例对象
     * @return 实例对象
     */
    @Override
    public  TappActinsCommunicateEntity update(TappActinsCommunicateEntity tappActinscommunicate) {
        this.baseMapper.updateById(tappActinscommunicate);
        return this.queryById(tappActinscommunicate.getFid());
    }

    /**
     * 通过主键删除数据
     *
     * @param fid 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Long fid) {
        return this.baseMapper.deleteById(fid) > 0;
    }
    /**
     * 查询多条数据
     * @menu 根据实体对象是否有值 进行查询
     * @return 对象列表
     */
    @Override
    public List<TappActinsCommunicateEntity> queryAll(TappActinsCommunicateEntity entity){
        return this.baseMapper.queryAll(entity) ;
    }

    @Override
    public List<TappActinsCommunicateEntity>  queryTodoCommunicate( String fapproversuser, Long factinsid,  Long fprocessinsid){
        return this.baseMapper.queryTodoCommunicate(fapproversuser,factinsid,fprocessinsid);
    }
}